# Contributor: Newbyte <newbyte@disroot.org>
# Maintainer: Newbyte <newbyte@disroot.org>
pkgname=moment
pkgver=0.7.3
pkgrel=1
pkgdesc="Qt/QML Matrix client"
url="https://mx-moment.xyz"
# armhf: blocked by py3-pyotherside, qt5-qtquickcontrols2
# s390x: blocked by py3-watchgod
arch="all !armhf !s390x"
license="LGPL-3.0-or-later"
replaces=mirage
provides="mirage=$pkgver-r$pkgrel"
options="!check" # requires types-aiohttp
depends="
	py3-aiofiles
	py3-appdirs
	py3-blist
	py3-cairosvg
	py3-filetype
	py3-hsluv
	py3-html-sanitizer
	py3-matrix-nio
	py3-mistune
	py3-pillow
	py3-plyer
	py3-pymediainfo
	py3-pyotherside
	py3-redbaron
	py3-simpleaudio
	py3-sortedcontainers
	py3-watchgod
	"
makedepends="
	libjpeg-turbo-dev
	libmediainfo-dev
	libwebp-dev
	libx11-dev
	libxscrnsaver-dev
	olm-dev
	openjpeg-dev
	py3-setuptools
	python3-dev
	qtchooser
	qt5-qtbase-dev
	qt5-qtquickcontrols2-dev
	qt5-qtsvg-dev
	qt5-qtimageformats
	tiff-dev
	zlib-dev
	"
_commit_hsluv_c=9e9be32d6010cad484a7b12b1a3d19c6cf4c1353
source="
	moment-v$pkgver.tar.gz::https://gitlab.com/mx-moment/moment/-/archive/v$pkgver/moment-v$pkgver.tar.gz
	hsluv-c.tar.gz::https://github.com/hsluv/hsluv-c/archive/$_commit_hsluv_c.tar.gz
	0001-Port-to-Mistune-2.0.2.patch
	"
builddir="$srcdir/$pkgname-v$pkgver"

prepare() {
	default_prepare
	mv "$srcdir/hsluv-c-$_commit_hsluv_c/"* "$builddir/submodules/hsluv-c"
}

build() {
	qmake CONFIG+=qtquickcompiler PREFIX=/usr moment.pro
	make
}

package() {
	make INSTALL_ROOT=$pkgdir install
}

sha512sums="
5ae34d3c6896f75caf449e1da72480724986915f7d084b7bc5e70be239da8fb48e45563c34c4da90085edccca8caf992dc70b8af3b6e052aba28f994d0bb18da  moment-v0.7.3.tar.gz
ecd8c9afa9e22c6a0093435ce89b5d5b1882207359d02a65f6e62952fa4b57fc5b3e1aaa07527553a7e86c350173409b21d41b3da5235a7fb5f96b61944be839  hsluv-c.tar.gz
cb67234f61173550543d40080bf889a8d1e96151e54d2e61a6421f70fcebbe4ef34fc0ff1bf767317ac2b705953c85ac8ac0567195f6b24c0d0a1313c1d2bbfa  0001-Port-to-Mistune-2.0.2.patch
"
